<template>
  <div class="my-collection">
    <div style="height:1px;"></div>
    <div class="list">
      <div class="item" v-for="(item, index) in detailsList" :key="index">
        <div class="img">
          <img :src="item.img" alt="" />
        </div>
        <div class="details">
          <div class="first_title">{{ item.name }}</div>
          <div class="second_title">
            <div class="left">{{ item.price }}</div>
            <div class="right">{{ item.describe }}</div>
          </div>
        </div>
        <div class="love"><img src="@/assets/icons/love.svg" alt="" /></div>
      </div>
    </div>
  </div>
</template>

<script lang="ts">
import { defineComponent, ref } from "vue";

export default defineComponent({
  setup() {
    const detailsList = ref([
      {
        img: require("@/assets/images/cupImg.png"),
        name: "巧克力咖啡",
        price: "$35,02",
        describe: "*折扣10%*",
      },
      {
        img: require("@/assets/images/cupImg.png"),
        name: "提拉米苏咖啡",
        price: "$440",
        describe: "",
      },
      {
        img: require("@/assets/images/cupImg.png"),
        name: "黑咖啡",
        price: "$100,04",
        describe: "*新品*",
      },
      {
        img: require("@/assets/images/cupImg.png"),
        name: "Senja咖啡",
        price: "$450,01",
        describe: "",
      },
    ]);
    return {
      detailsList,
    };
  },
});
</script>

<style lang="less" scoped>
.my-collection {
  background-image: url("~@/assets/images/pureImg.jpg");
  min-height: 100vh;

  .list {
    background: #fff;
    margin: 60px 30px;
    .item {
      padding: 30px;
      display: flex;
      align-items: center;
      font-size: 32px;
      border-bottom: 2px solid rgba(151, 151, 151, 0.19);
      &:last-child {
        border: none;
      }
      .img {
        width: 96px;
        height: 96px;
        background: #1c2238;
        border-radius: 10px;
        margin-right: 32px;
        img {
          width: 96px;
          height: 96px;
        }
      }
      .details {
        flex: 1;
        .first_title {
          font-size: 32px;
          font-family: Helvetica;
          color: #333333;
          line-height: 38px;
          margin-bottom: 12px;
        }
        .second_title {
          display: flex;
          font-size: 24px;
          font-family: Helvetica;
          line-height: 28px;
          .left {
            color: #939393;
            margin-right: 8px;
          }
          .right {
            color: #f6a44e;
          }
        }
      }
      .love {
        width: 82px;
        height: 74px;
        background: #ffffff;
        border-radius: 16px;
        border: 2px solid #dee2ee;
        display: flex;
        justify-content: center;
        align-items: center;
        img {
          width: 26px;
          height: 24px;
        }
      }
    }
  }
}
</style>